package com.example.w.common.pojo;

import java.io.Serializable;
import java.util.List;

import com.example.w.common.util.Utils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * user_tb
 * @author 
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class User implements Serializable {
    /**
     * 用户id
     */
    private Long id;

    /**
     * 用户名
     */
    private String username;

    /**
     * 密码
     */
    private String password;

    /**
     * 加密盐
     */
    private String salt;

    private static final long serialVersionUID = 1L;

    /**
     * 角色集合
     */
    private List<Role> roles;

    public boolean hasUsernameAndPasswd() {
        return !Utils.isEmpty(username) && !Utils.isEmpty(password);
    }
}